<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" import="java.util.*"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9,chrome=1">
<title>${webName}</title>
<link rel="stylesheet" href="${res}/layui/css/layui.css">
<link rel="stylesheet" href="${res}/story/css/html.css">
</head>
<body>
	<div class="story-registe-form layui-anim layui-anim-scaleSpring">
		<div class="story-h1">小故事后台注册</div>
		<br>
		<form class="layui-form layui-form-pane" style="padding-left:50px;padding-right:50px;" action="${base}/manager/registe/do" method="post">
			<div class="layui-form-item">
				<label class="layui-form-label"><i class="layui-icon">&#xe612;</i>&nbsp;用户名</label>
	    		<div class="layui-input-block">
	     			<input type="text" name="username" lay-verify="username" autocomplete="off" placeholder="请输入用户名" class="layui-input">	    		
	    		</div>
	    		<span>${errors.username}</span>
	    	</div>
	    	<div class="layui-form-item">
				<label class="layui-form-label"><i class="layui-icon">&#xe6b2;</i>&nbsp;密码</label>
	    		<div class="layui-input-block">
	     			<input type="password" name="password" lay-verify="password" autocomplete="off" placeholder="请输入密码" class="layui-input">
	    		</div>	
	    		<span>${errors.password}</span>
	    	</div>	
	    	<div class="layui-form-item">
				<label class="layui-form-label"><i class="layui-icon">&#xe6b2;</i>&nbsp;确认密码</label>
	    		<div class="layui-input-block">
	     			<input type="password" name="repassword" lay-verify="repassword" autocomplete="off" placeholder="请再次确认密码" class="layui-input">
	    		</div>		    		
	    	</div>	
	    	<br/>
			<div class="layui-form-item" align="center">
			    <button class="layui-btn  layui-btn-normal " lay-submit="" lay-filter="registe" style="background-color:#009688;"><i class="layui-icon">&#x1005;</i>&nbsp;注册</button>
			 	<br/><br/><span style="padding:10px;color:#000000;">已经有账号了？点这里<a href="${base}/manager/login" style="color:#FF5722;">登录</a></span>
			 </div>
		</form>
	</div>
	
	<script src="${res}/layui/layui.all.js" charset="utf-8"></script>
	<script type="text/javascript">
		;!function(){
			$ = layui.$;
			var layer = layui.layer;
			var form = layui.form;	
			form.verify({
			    username:[/^[A-Za-z][A-Za-z1-9_-]{5,14}$/,'必须6到15位字母或数字，首位须为字母！']		    
			    ,password: [/^\S{6,30}$/, '密码必须6到30位']
			    ,repassword:function(value){
			    	var passwordValue = $('input[name=password]').val();
			    	if(value != passwordValue){
			    		return '两次输入的密码不一致!';
			    	}
			    }
			  });
			 form.on('submit(registe)', function(data){
				    return true;
				 });
			}();
	</script>
	<c:if test="${error!=null}">
		<script type="text/javascript">
			layer.msg('用户已存在！');
		</script>
	</c:if>
</body>
</html>